package com.hducms.cms.service;

import java.util.List;
import java.util.Map;

import com.hducms.cms.entity.main.Channel;
import com.hducms.cms.entity.main.ChannelExt;
import com.hducms.cms.entity.main.ChannelTxt;
import com.hducms.cms.entity.main.CmsGroup;
import com.hducms.cms.entity.main.CmsModel;
import com.hducms.cms.entity.main.CmsUser;
//import com.jeecms.cms.entity.main.ChannelExt;
//import com.jeecms.cms.entity.main.ChannelTxt;
import com.hducms.common.page.Pagination;

/**
 * 栏目管理接口
 */
public interface ChannelService {
	/**
	 * 获得顶级栏目
	 * 
	 * @param siteId
	 *            站点ID
	 * @param hasContentOnly
	 *            是否只获得有内容的栏目
	 * @return
	 */
	public List<Channel> getTopList(boolean hasContentOnly);
//
	public List<Channel> getTopListByRigth(Integer userId,
			boolean hasContentOnly);
//
//	public List<Channel> getTopListForTag(Integer siteId, boolean hasContentOnly);
//
//	public Pagination getTopPageForTag(Integer siteId, boolean hasContentOnly,
//			int pageNo, int pageSize);
//
	public List<Channel> getChildList(Integer parentid, boolean hasContentOnly);

	/**
	 * 根据用户权限获取子栏目列表
	 * @param userId
	 * @param parentId
	 * @param hasContentOnly
	 * @return
	 */
	public List<Channel> getChildListByRight(Integer userId, 
			Integer parentId, boolean hasContentOnly);
//
//	public List<Channel> getChildListForTag(Integer parentId,
//			boolean hasContentOnly);
//
//	public Pagination getChildPageForTag(Integer parentId,
//			boolean hasContentOnly, int pageNo, int pageSize);
//
//	public Channel findByPath(String path, Integer siteId);
//
//	public Channel findByPathForTag(String path, Integer siteId);
//
	public Channel findById(Integer id);

	public Channel save(Channel bean, ChannelExt ext, ChannelTxt txt,
			Integer[] viewGroupIds, Integer[] contriGroupIds,
			Integer[] userIds, Integer siteId, Integer parentId, Integer modelId,Integer[]modelIds,String[] tpls);

	public Channel update(Channel bean, ChannelExt ext, ChannelTxt txt,
			Integer[] viewGroupIds, Integer[] contriGroupIds,
			Integer[] userIds, Integer parentId, Map<String, String> attr,Integer[]modelIds,String[] tpls);

//	public Channel deleteById(Integer id);
//
	public Channel[] deleteByIds(Integer[] ids);
//
//	public Channel[] updatePriority(Integer[] ids, Integer[] priority);
//
	public String checkDelete(Integer id);
	public CmsGroup findViewGroupById(Integer id);
	public CmsGroup findContriGroupById(Integer id);
	public Integer[] findViewGroupIdById(Integer id);
	public Integer[] findContriGroupIdById(Integer id);
	public Integer[] findUserIdById(int parentId);
	public CmsUser findUserById(Integer integer);
	public CmsModel findModelByid(int modelId);
	public ChannelExt findChannelExt(Integer id);
	public Integer[] findViewChannelIdsByGroupId(int groupId);
	public Integer[] getViewGroupIds(int channelId);
}